import moment from 'moment';

import { Divider } from 'antd';

export default [{
    title: '奖品名称',
    dataIndex: 'GoodsPrizes',
    // width: '25%',
    render: row => Array.isArray(row) && row.map(i => (
      <span key={i.id}>
        {i.title}
        <Divider dashed style={{margin: 0}} />
      </span>
    )),
  }, {
    title: '开奖条件',
    dataIndex: 'type',
    render: text => text === 0 ? '按时间开奖' : text === 1 ? '按人数开奖' : '其它'
  }, {
    title: '开奖人数',
    dataIndex: 'number',
    render: text => <span>{text}人</span>
  }, {
    title: '发起人',
    dataIndex: 'nickname',
  },
  // {
  //   title: 'PV',
  //   dataIndex: 'pv',
  //   render: val => '功能待设计',
  // }, {
  //   title: 'UV',
  //   dataIndex: 'uv',
  //   render: val => '功能待设计',
  // }, 
  {
    title: '参与人数',
    dataIndex: 'join',
    render: text => <span>{text}人</span>
  }, {
    title: '中奖人数',
    dataIndex: 'winning',
    render: text => <span>{text}人</span>
  }, {
    title: '开奖时间',
    dataIndex: 'endAt',
    render: val => <span style={{whiteSpace: 'nowrap'}}>{moment(val).format('YYYY-MM-DD HH:mm')}</span>,
  }
];